package com.plant.tool;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class Test {
		public static Integer CountSameList(List<Object> list){//--共同好友
			Integer count=0;
	        int x = list.size();
	        while(list.size()!=0){
	            List<Object> arr =  list;
	            Integer obj = Integer.parseInt(list.get(0).toString());
	            List<Integer> l1 = new ArrayList<Integer>();
	            l1.add(obj);
	            arr.removeAll(l1);
	            count=count+(x-arr.size()-1);
	            x = arr.size();
	        }
			return count;
		}
		
		public static Set<String> OnlyList(List<String> list){//--去除重复的数据
			Set<String> set=new HashSet<String>(list);
			return set;
		}
		
		public static StringBuffer OnlyChinese(String parm){//---
	        StringBuffer sb = new StringBuffer();
	        for (int i = 0; i < parm.length(); i++) {
	            if ((parm.charAt(i)+"").getBytes().length>1) {
	                sb.append(parm.charAt(i));
	            }
	        }
	        return sb;
		};
}
